package cat.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cat.entity.Category;
import cat.service.CategoryService;

@Controller @RequestMapping("/category")
public class CategoryController {
	
	@Resource
	private CategoryService categoryService;
	
	@ResponseBody@RequestMapping("/listsub")
	public List<Category> listSubCategory(Integer parentCateId) {
		List<Category> categoryList =categoryService.listCategoryByParentId(parentCateId);
		return  categoryList;
	}	
}